﻿<%@ Page Title="" Language="C#" MasterPageFile="~/manager.Master" AutoEventWireup="true" CodeBehind="reportfinal.aspx.cs" Inherits="Bus_proj.website.reportfinal" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/Stylebuttoncss.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/textbox.css" rel="stylesheet" type="text/css" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style4
        {
            width: 201px;
        }
        .style5
        {
            width: 257px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Bus_proConnectionString %>" 
        
        
        
        SelectCommand="SELECT Table_Sale.Sale_id, Table_Sale.Passenger_id, Table_Sale.Sale_date, Table_Sale.Sale_time, Table_Sale.Promotion_id, Table_Sale.Point_id, Table_Sale.Personnel_id, Table_Sale.Around_id, Table_Sale.SSID, Table_Sale.percentage, Table_SaleDetail.Seat_id, Table_SaleDetail.Seat_no, Table_SaleDetail.Sale_id AS Expr1, Table_SaleDetail.Price_ticket, Table_SaleDetail.tex, Table_SaleDetail.Around_id AS Expr2, Table_Promotion.Promotion_id AS Expr3, Table_Promotion.Promotion_name, Table_Promotion.Promotion_discount, Table_Promotion.Promotion_status, Table_Passenger.Passenger_id AS Expr4, Table_Passenger.Passenger_prefix, Table_Passenger.Passenger_name, Table_Passenger.Passenger_surname, Table_Passenger.Passenger_sex, Table_Passenger.Passenger_birthday, Table_Passenger.Passenger_home_no, Table_Passenger.Passenger_village_no, Table_Passenger.Passenger_lane, Table_Passenger.Passenger_road, Table_Passenger.Passenger_district, Table_Passenger.Passenger_sub_district, Table_Passenger.Passenger_province, Table_Passenger.Passenger_post, Table_Passenger.Passenger_tel, Table_Passenger.Passenger_mail, Table_Passenger.Access_id, Table_Passenger.Category_id, Table_Passenger.Passenger_identification, Table_Passenger.password, Table_Category.Category_id AS Expr5, Table_Category.Category_name, Table_Category.Category_Discount, Table_SSID.SSID AS Expr6, Table_SSID.SS_name FROM Table_Sale INNER JOIN Table_SaleDetail ON Table_Sale.Sale_id = Table_SaleDetail.Sale_id INNER JOIN Table_Promotion ON Table_Sale.Promotion_id = Table_Promotion.Promotion_id INNER JOIN Table_Passenger ON Table_Sale.Passenger_id = Table_Passenger.Passenger_id INNER JOIN Table_Category ON Table_Passenger.Category_id = Table_Category.Category_id INNER JOIN Table_SSID ON Table_Sale.SSID = Table_SSID.SSID WHERE ((Table_Sale.SSID = 1) OR (Table_Sale.SSID = 4 OR Table_Sale.SSID = 5)) and (Table_Sale.Sale_time BETWEEN @start_date AND @end_date)">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="1900-01-01 00:00:00" Name="start_date" 
                SessionField="start_date" />
            <asp:SessionParameter DefaultValue="1900-01-01 23:00:00" Name="end_date" 
                SessionField="end_date" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />    
    </Triggers>
     <asp:Panel ID="Panel1" runat="server">
        <fieldset class="el03" >
<legend>เลือกวัน-เดือน-ปีที่ต้องการแสดงรายรับ</legend>
<table class="style1">
        <tr>
            <td align="right" class="style5">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
            <td rowspan="4">
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="ค้นหา" 
                    Height="40px" Width="111px" CssClass="classname" />
            </td>
        </tr>
        <tr>
            <td align="right" class="style5">
                <asp:Label ID="Label1" runat="server" Text="วัน-เดือน-ปี เริ่มต้น :"></asp:Label>
            </td>
            <td class="style4">
                <asp:TextBox ID="TextBox1" runat="server" Height="22px" TextMode="Date" 
                    Width="176px" CssClass="textbox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5">
                <asp:Label ID="Label2" runat="server" Text="วัน-เดือน-ปี สิ้นสุด :"></asp:Label>
            </td>
            <td class="style4">
                <asp:TextBox ID="TextBox2" runat="server" Height="21px" TextMode="Date" 
                    Width="176px" CssClass="textbox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" class="style5">
                &nbsp;</td>
            <td class="style4">
                &nbsp;</td>
        </tr>
    </table>
</fieldset>
    </asp:Panel>

    <br>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
        Font-Size="8pt" InteractiveDeviceInfos="(Collection)" 
        WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="835px" 
        Height="872px" style="text-align: center">
        <LocalReport ReportPath="website\Reportfinal.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
    </ContentTemplate>
    </asp:UpdatePanel>
   
</asp:Content>
